<template>
	<view>
		<view class="header">
			<u-navbar
				:background="{ backgroundColor: '#3478F2' }"
				back-icon-color="#fff"
				back-icon-name="arrow-left"
				back-icon-size="40"
				:custom-back="back"
				title="补充信息"
				title-color="#fff"
				title-size="40"
				title-bold
			></u-navbar>
		</view>
		<scroll-view scroll-top="0" scroll-y="true" :style="`height:${scrollHeight}px`">
			<view class="page" @click.stop="handleDec">
				<view class="top">填写补充资料，下款成功率提高30%</view>
				<view class="content">
					<view class="box">
						<view>
							<text class="star">*</text>
							<text class="box_text">社保缴纳</text>
						</view>
						<view class="box_right" @click.stop="open">
							<text>{{ form.shebao }}</text>
							<view class="img">
								<image src="/static/icon/sanjiao1.png" mode="scaleToFill" />
								<view class="sel" v-if="isActive">
									<view class="opt" v-for="item in option" :key="item.value" @click.stop="handleItem(item.value)" :class="active == item.value ? 'active' : ''">
										{{ item.value }}
									</view>
								</view>
							</view>
						</view>
					</view>
					<view class="box">
						<view>
							<text class="star">*</text>
							<text class="box_text">社保缴纳</text>
						</view>
						<view class="box_right" @click.stop="open">
							<text>{{ form.shebao }}</text>
							<view class="img">
								<image src="/static/icon/sanjiao1.png" mode="scaleToFill" />
								<view class="sel" v-if="isActive1">
									<view class="opt" v-for="item in option" :key="item.value" @click.stop="handleItem(item.value)" :class="active == item.value ? 'active' : ''">
										{{ item.value }}
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
				<view class="pd">
					<view class="btn headle" @click="sub">提交</view>
					<view class="tips1">
						<image src="/static/icon/dun-pai@3x.png" mode="scaleToFill" />
						<text>国家级数据加密保护，仅用于贷款审核</text>
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
import { mixin } from '@/utils/mixins'
// import ajax from '@/api'
export default {
	mixins: [mixin],
	data() {
		return {
			list: '',
			isActive: false,
			isActive1: false,
			active: '请选择',
			option: [{ value: '无社保' }, { value: '未满6个月' }, { value: '6个月以上' }],
			form: {
				shebao: '请选择'
			}
		}
	},
	onLoad() {
		// this.init()
	},
	methods: {
		// async init() {
		// 	try {
		// 		const data = await ajax.getEnume()
		// 		if (data.length) {
		// 			data.forEach((item) => {
		// 				item.value.forEach((v) => {
		// 					v.flag = false
		// 				})
		// 			})
		// 		}
		// 		console.log(data)
		// 		this.list = data
		// 	} catch (error) {
		// 		console.log(error)

		// }
		sub() {
			uni.navigateTo({
				url: '/pages/financial/putSucceeA'
			})
		},
		back() {
			uni.switchTab({
				url: '/pages/financial/index'
			})
		},
		//点击页面下拉框隐藏
		handleDec() {
			this.isActive = false
		},
		open() {
			this.isActive = !this.isActive
		},
		handleItem(val) {
			console.log(val)
			this.active = val
			this.form.shebao = val
			setTimeout(() => {
				this.isActive = false
			}, 80)
		}
	}
}
</script>

<style lang="scss" scoped>
.top {
	width: 100vw;
	height: 64rpx;
	background: #e4eeff;
	font-size: 32rpx;
	font-family: PingFang SC;
	font-weight: 400;
	color: #3478f2;
	text-align: center;
	line-height: 64rpx;
}
.page {
	font-family: PingFang SC;
	height: 100%;
	background: #ffffff;
	position: relative;
}
.content {
	padding: 32rpx;
}
.box {
	margin-bottom: 44rpx;
	display: flex;
	justify-content: space-between;
	.star {
		font-size: 32rpx;
		font-weight: bold;
		color: #fc1f1f;
		margin-right: 14rpx;
	}
	.box_text {
		font-size: 32rpx;
		font-weight: 400;
		color: #969799;
		line-height: 60rpx;
	}
	.box_right {
		width: 470rpx;
		height: 60rpx;
		background: #ffffff;
		border: 1rpx solid #bdbdbd;
		border-radius: 8rpx;
		padding-right: 48rpx;
		display: flex;
		justify-content: flex-end;
		align-items: center;
		box-sizing: border-box;
		image {
			width: 22rpx;
			height: 14rpx;
			margin-left: 12rpx;
		}
		.img {
			position: relative;
		}
		.sel {
			position: absolute;
			width: 470rpx;
			height: 274rpx;
			background: #ffffff;
			border: 4rpx solid #bdbdbd;
			box-shadow: 0px 0px 30rpx rgba(0, 0, 0, 0.25);
			border-radius: 8rpx;
			bottom: -288rpx;
			right: -50rpx;
			.opt {
				width: 470rpx;
				height: 88rpx;
				text-align: center;
				line-height: 88rpx;
				font-size: 36rpx;
				font-family: PingFang SC;
				font-weight: 400;
				border-bottom: 2rpx solid #e4e4e4;
				&:last-child {
					border: 0;
				}
			}
			.active {
				color: #3478f2;
			}
		}
	}
}
.pd {
	padding: 0 32rpx;
	position: absolute;
	bottom: 200rpx;
	width: 100vw;
}
.btn {
	margin-top: 28rpx;
	height: 92rpx;
	background: linear-gradient(270deg, #0481fe 0%, #40c5fe 100%);
	line-height: 92rpx;
	text-align: center;
	border-radius: 70rpx;
	font-size: 36rpx;
	font-family: PingFang SC;
	font-weight: 400;
	color: #ffffff;
}
.tips1 {
	margin-top: 16rpx;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 28rpx;
	font-family: PingFang SC;
	font-weight: 400;
	color: #bdbdbd;
	image {
		width: 24rpx;
		height: 28rpx;
		margin-right: 12rpx;
	}
}
</style>
